// 2.创建切片
import { createSlice } from '@reduxjs/toolkit'
const tabSlice = createSlice({
    name: 'tab', //命名空间
    initialState: {
        isCollapse: false
    },
    reducers: {
        collapseMenu(state, action) {
            state.isCollapse = !state.isCollapse
        }

    }
})

// actions 中会包含当前 reducers中的所有方法
export const { collapseMenu } = tabSlice.actions

export default tabSlice.reducer